//
//  UIImage+Common.h
//  MengLiao
//
//  Created by xiuxin on 2022/7/15.
//  Copyright © 2022 BaseBusiness. All rights reserved.
//

#import <UIKit/UIKit.h>

typedef NS_ENUM(NSUInteger, LM_GradientType) {
    
   LM_GradientTypeTopToBottom = 0,//从上到下
   LM_GradientTypeLeftToRight = 1,//从左到右
   LM_GradientTypeUpleftToLowright = 2,//左上到右下
   LM_GradientTypeUprightToLowleft = 3,//右上到左下
    
};
@interface UIImage (Common)


+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size corner:(CGFloat)cornerRadius;


+ (UIImage *)gradientColorImageFromColors:(NSArray <UIColor *>*)colors
                             gradientType:(LM_GradientType)gradientType
                                  imgSize:(CGSize)imgSize;

/*
@param pixelBufffer 图片的CVPixelBufferRef
@return UIimage
*/
+ (UIImage*)pixelBufferToImage:(CVPixelBufferRef)pixelBufffer;

@end
